#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
#include "demosystemdbus.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    //新建一个systemBus
    QDBusConnection systemBus = QDBusConnection::systemBus();
    //注册com.demo.qt.systemdbus 服务
    if (systemBus.registerService("com.demo.qt.systemdbus")){
        //注册对象
        systemBus.registerObject("/", new DemoSystemDbus(),
                                 QDBusConnection::ExportAllSlots |
                                 QDBusConnection::ExportAllSignals
                                 );
    }
    return a.exec();
}
